﻿#ifndef COMMDEF_H
#define COMMDEF_H

#include <QObject>
#include <QDebug>
#include <QMutex>
#include <QMutexLocker>
#include <QThread>
#include <QTimer>
#include <QDateTime>
#include <QFile>
#include <QDir>
#include <QMap>
#include <QLibrary>
#include <QSettings>
#include <QTextCodec>
#include "moduleid.h"

//
#ifndef TPURE
#define TPURE    =0
#endif
typedef long TRESULT;
#define T_OK    0
#define T_FALSE 1
#define SUCCEEDT(hr)\
    ((hr) == T_OK)
#define FAILEDT(hr)\
    ((hr) == T_FALSE)

#ifndef SAFE_DELETE
#define SAFE_DELETE(p) { if(p){delete (p);(p) = NULL;}}
#endif
#ifndef SAFE_DELETE_ARRAY
#define SAFE_DELETE_ARRAY(p) {if(p) {delete [] (p); (p) = NULL;}}
#endif
#ifndef SAFE_FREE
#define SAFE_FREE(p) {if(p){free(p);(p)=NULL;} }
#endif

//#if _MSC_VER >= 1600
//#pragma execution_character_set("utf-8")
//#endif

#endif // COMMDEF_H
